package untitled;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class Text2 {
    public static void main(String[] args) throws Exception{
        FileReader reader = new FileReader("D:\\测试\\读取的文件.txt");
        BufferedReader br = new BufferedReader(reader);
        FileWriter writer =new FileWriter("D:\\测试\\写入的目标文件.txt");
        BufferedWriter bw = new BufferedWriter(writer);
        String str;
        while ((str = br.readLine())!=null){
            bw.write(str);
            bw.newLine();
        }
        br.close();
        bw.close();
    }
}
